Skip to content

Conversation

BJP-GU
Copy link
Contributor

@BJP-GU BJP-GU commented Aug 7, 2025

Description

This PR covers the entirety of the development of the @-feature in the chat-input field of Onlook's right-panel. The @-Feature, much like the one in Cursor/VS code, Notion, etc., allows for users to @-mention folders, files, code, and design-panel elements such as brand styles, images, and pages, inside of Onlook's AI Chat window.

Key Features:

  • Typing "@" in the Chat Input opens up the "At Menu"
  • Fuzzy Search: When a user types "@[followed by anything]" the projects files, folders, code, etc. is queried for a match and the results are shown in the At Menu modal. (note: The fuzzy search, once paired with the 100% real project data in Onlook should be tested to ensure it is working properly).
  • The At Menu contains four main sections: Recents, Folders & Files, Code, and Design Panel.
  • The Recents section is comprised of the most recent files which you've interacted with; I've included logic in the PR for how recents are returned.
  • Items which are "Parents" to other items (e.g., folders) are able to be opened in the menu and explored.

Interactions/Behaviors:

  • The At Menu is navigable by mouse and keyboard controls; key board controls include up and down arrows, right and left arrows for going in and out of parent files, enter for selecting files, and backspace or ESC for exiting the menu.
  • Chat input functions: @ = opens menu, @[searchterm]/ = opens specified folder.

Related Issues

N/A

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Release
  • Refactor
  • Other (please describe):

Testing

  • Type "@" into the Chat Input --> @ Menu appears
  • Type @brand/ --> Brand Option Open
  • Hover on the @ Menu --> Hover states appear for each item
  • Scroll with trackpad/mouse --> Menu scrolls (if contents allow it).
  • Key up and down the at-menu with arrow keys --> "Hover" states apply to menu items as you navigate the menu, menu scrolls naturally, menu loops back to beginning.
  • Add @-menu items to the Chat Input --> @-mentioned items should appear different that regular text.

Screenshots (if applicable)

@-Menu Open:
image

@-sub-menu (child menu) Open:
image

@-mention's added to Chat-Input:
image

Video Demo:
https://github.com/user-attachments/assets/1375ad09-0ef0-4251-8609-b22dad0f70e9

Additional Notes

I used Onlook to prototype the @-feature. Ultimately, the design I implemented in this PR differs slightly from the prototype (this PR is more robust). Have a look at the prototype for a general overview of the functionality of the feature.

Onlook Prototype: https://www.onlook.com/project/a71c51f2-fd13-4584-a20f-fe41268b8515

I need someone to help with the following touches:

  • Ensure the At Menu items are using actual data from the project's code base and the Left (Design) Panel.
  • Ensure that the AI Model running in the chat understands how to read the @-mentions -- such that they actually add productive context to prompts.
  • Ensure the Fuzzy Search is working optimally against the real data.

Important

Introduces @-feature in chat input for mentioning files, folders, and design elements with a new At Menu, fuzzy search, and recent activity tracking.

  • Behavior:
    • Adds @-feature in chat input for mentioning files, folders, code, and design elements.
    • Introduces At Menu with sections for Recents, Folders & Files, Code, and Design Panel.
    • Implements fuzzy search for @ mentions.
    • Supports keyboard and mouse navigation in At Menu.
    • Tracks recent activities for quick access.
  • Components:
    • Adds AtMenu, MenuItem, and related components in right-panel/chat-tab/at-menu/.
    • Updates ChatInput in chat-input/index.tsx to handle @ mentions and At Menu interactions.
    • Adds RecentActivityTracker for tracking recent file and tab activities.
  • Models:
    • Adds MentionMessageContext to context.ts for handling mention contexts.
  • Misc:
    • Updates providers.ts to handle API key errors more gracefully.
    • Adds tests for data providers in data-providers.test.ts.

This description was created by Ellipsis for 32fd603. You can customize this summary. It will automatically update as commits are pushed.

BJP-GU added 5 commits August 1, 2025 17:41
Created v.0 of @ menu.
UI Sanding, UX improvements, and added keyboard shortcut functionality.
Refined keyboard controls, resolved spacing from cursor issues, fixed parent-child nesting, implemented @.../ feature.
Copy link

vercel bot commented Aug 7, 2025

@BJP-GU is attempting to deploy a commit to the Onlook Team on Vercel.

A member of the Team first needs to authorize it.

Added color swatches, resolved ellipsis font and color issue, fixed a few bugs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant